<?php

namespace stlswm\DouyinOpenApi\pay\ecpay;

/**
 * 异步通知签名
 */
class NotifySign
{
    /**
     * @param  string  $token
     * @param  array   $map
     * @return string
     */
    public static function sign(string $token, array $map): string
    {
        unset($map['msg_signature']);
        unset($map['type']);
        $map['token'] = $token;
        sort($map, SORT_STRING);
        $str = join("", $map);
        return sha1($str);
    }
}